#include "SMPPMsValidity.hpp"

using namespace smpp::pdu;

MsValidity::MsValidity(const octetString &nValue):
TLV(TLVtags::TAG_MS_VALIDITY,nValue.size()),_Value(nValue){}

MsValidity::MsValidity(const MsValidity &nMsValidity):
TLV(nMsValidity),_Value(nMsValidity.getValue()){}

bool MsValidity::operator ==(const MsValidity &nMsValidity) const{
	return (TLV::operator == (nMsValidity) && 
			_Value == nMsValidity.getValue());
}

bool MsValidity::operator !=(const MsValidity &nMsValidity) const{
	return !this->operator == (nMsValidity);
}

MsValidity &MsValidity::operator = (const MsValidity &nMsValidity){
	if(*this == nMsValidity)
		return *this;
	TLV::operator = (nMsValidity);
	_Value = nMsValidity.getValue();
	return *this;
}

void MsValidity::setValue(const octetString &nValue){
	_Value = nValue;
}

const octetString &MsValidity::getValue() const{
	return _Value;
}
